<?php
/**
 *
 *
 * @author Zeon <scplay@gmail.com>
 * @date 2019/5/28 14:36
 * @copyright PanxSoft Inc.
 */

namespace App\Http\Controllers\WebView\V1;


use App\Http\Controllers\ApiController;
use App\Models\Coupon\CouponTicket;
use Illuminate\Http\Request;

class CouponTicketController extends ApiController
{
    const ROUTES = [
        'index'   => 'webview.v1.coupon-ticket.index',
    ];

    /**
     *
     * @param Request $request
     *
     * @return array|\Illuminate\Http\Response
     */
    public function index(Request $request)
    {
        $coupon_tickets = (new CouponTicket)
            ->oldest('sort_order')
            ->get();

        return $this->response(compact('coupon_tickets'));
    }
}